//Tiempo que se demora en mostrar coincidencias
var timeShowText=1500;
var _divTxt;
var _ajaxTxt=null;
var _timerText=null;
var _txtObject;
function _stxtBlur(){
	setTimeout("_txtBlur()",1000);
}
function _txtBlur(){
	//if (_divTxt==null) return;
	var uls = _divTxt.getElementsByTagName('ul');
	uls[0].innerHTML="";
}
function _setValueTxt(Object){
	var key=Object.id;
	var value=Object.innerHTML;
	while (Object.id!='divBusqueda'){Object = Object.parentNode;}
	var inputs = Object.getElementsByTagName('input');
	inputs[0].value=key;
	inputs[1].value=value;
	var uls = Object.getElementsByTagName('ul');
	uls[0].innerHTML="";
}
function _txtKeyPress(Object, view, page){
	//var test = document.getElementById("divTest");
	if (_ajaxTxt){
		//test.innerHTML = test.innerHTML+" Eliminar";
		if (_ajaxTxt.getRequest().readyState!=4){
			_ajaxTxt.getRequest().abort();
		}
		_ajaxTxt = null;
	}
	_txtObject = Object;
	while (Object.id!='divBusqueda'){Object = Object.parentNode;}
	_divTxt = Object;
	var f = "_getValuesTxt('"+view+"', '"+page+"')";
	clearTimeout(_timerText);
	//Tiempo q se demora en mostrar
	_timerText = setTimeout(f,timeShowText);
}
function _getValuesTxt(view, page){	
	var test = document.getElementById("divTest");
	var txt=_txtObject;
	var url ="class/"+page+"?view="+view+"&type=showTxt&value="+txt.value;
	divs = _divTxt.getElementsByTagName("ul");
	div = divs[0];
	//div.innerHTML="hola mundo";
	//test.innerHTML = test.innerHTML+" buscar*"+txt.value+"*"+url;
	_ajaxTxt = getPageHTML(url, div);
	
}